﻿using System;
using System.Configuration;
using System.Data;

using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using Microsoft.Reporting.WebForms;

namespace dcwj
{
    public partial class dbbg : System.Web.UI.Page
    {
        private String M_CONSTR = ConfigurationManager.ConnectionStrings["dcwjConnectionString"].ToString();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {

                    int n = Int32.Parse(Request["paperid"].ToString());
                    //if(!string.IsNullOrEmpty(pid) && string.
                    Database objDB = new SqlDatabase(M_CONSTR);
                    DataSet dsTmp = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.课程内容,
                    b.培训方法,
                    c.关于讲师,
                    d.培训组织
                    from

                    (SELECT 
                    avg(cast (QAnswer as decimal)) as 课程内容
                      FROM Table_RESULT
                    where paperid =" +n.ToString()+ @" and Qid in(1,2,3,4,5)) as a,

                    (SELECT 
                    avg(cast (QAnswer as decimal)) as 培训方法
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6,7,8)) as b,

                    (SELECT 
                    avg(cast (QAnswer as decimal)) as 关于讲师
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9,10,11,12,13)) as c,

                    (SELECT 
                    avg(cast (QAnswer as decimal)) as 培训组织
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14,15,16,17)) as d
                    ");

                    DataSet dsTmp2 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(1,2,3,4,5) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(1,2,3,4,5) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(1,2,3,4,5) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(1,2,3,4,5) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(1,2,3,4,5) and QAnswer=1) as e

                    ");

                    DataSet dsTmp3 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                                a.针对性,
                                b.实用性,
                                c.启发性,
                                d.完整性,
                                e.时效性
                                from

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 针对性
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(1)) as a,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 实用性
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(2) ) as b,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 启发性 
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(3)) as c,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 完整性 
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(4)) as d,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 时效性
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(5)) as e

                                ");

                    DataSet dsTmp4 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6,7,8) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6,7,8) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6,7,8) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6,7,8) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6,7,8) and QAnswer=1) as e

                    ");

                    DataSet dsTmp5 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                                a.课堂活动,
                                b.师生互动,
                                c.教学媒体使用
                                from

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 课堂活动
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(6)) as a,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 师生互动
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(7) ) as b,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 教学媒体使用
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(8)) as c
                                ");

                    DataSet dsTmp6 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9,10,11,12,13) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9,10,11,12,13) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9,10,11,12,13) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9,10,11,12,13) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9,10,11,12,13) and QAnswer=1) as e

                    ");

                    DataSet dsTmp7 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                                a.围绕课程主题,
                                b.合理安排时间,
                                c.活跃课堂气氛,
                                d.授课热情认真,
                                e.专业知识丰富
                                from

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 围绕课程主题
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(9)) as a,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 合理安排时间
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(10) ) as b,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 活跃课堂气氛
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(11)) as c,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 授课热情认真
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(12)) as d,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 专业知识丰富
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(13)) as e

                                ");


                    DataSet dsTmp8 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14,15,16,17) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14,15,16,17) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14,15,16,17) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14,15,16,17) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14,15,16,17) and QAnswer=1) as e

                    ");

                    DataSet dsTmp9 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                                a.培训环境,
                                b.后勤组织,
                                c.教学设备,
                                d.培训材料
                                from

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 培训环境
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(14)) as a,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 后勤组织
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(15) ) as b,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 教学设备
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(16)) as c,

                                (SELECT 
                                avg(cast (QAnswer as decimal)) as 培训材料
                                  FROM Table_RESULT
                                where paperid = " + n.ToString() + @" and Qid in(17)) as d
                                ");

                    string pTitle = objDB.ExecuteScalar(CommandType.Text, @"SELECT PaperName  FROM Table_PAPER where paperid=" + n.ToString()).ToString();
                    titleControl.Text = pTitle;
                    DataSet dsTmp10 = objDB.ExecuteDataSet(CommandType.Text, @"SELECT 
                                              PaperName,
                                              (select BrandName from Table_BRAND where BrandID = p.BrandID) as BrandName,
                                              (select RegionName from Table_REGION where RegionID = p.RegionID) as RegionName,
                                              (select PositionName from Table_POSITION where PositionID = p.PositionID) as PositionName,
                                              (select TeacherName from Table_TEACHER where TeacherID = p.TeacherID) as TeacherName,
                                              (select PaperClassName from Table_PAPERCLASS where PaperClassID = p.PaperClassID) as PaperClassName,
                                              CONVERT(varchar(100), StartTime, 23) as StartTime,
                                              CONVERT(varchar(100), EndTime, 23) as EndTime,
                                              SubmitTimes
                                              FROM Table_PAPER p
                                              where p.paperid=" + n.ToString());


                    DataSet dsQ1 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(1) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(1) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(1) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(1) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(1) and QAnswer=1) as e");

                    DataSet dsQ2 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(2) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(2) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(2) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(2) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(2) and QAnswer=1) as e");


                    DataSet dsQ3 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(3) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(3) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(3) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(3) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(3) and QAnswer=1) as e");


                    DataSet dsQ4 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(4) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(4) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(4) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(4) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(4) and QAnswer=1) as e");


                    DataSet dsQ5 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(5) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(5) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(5) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(5) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(5) and QAnswer=1) as e");


                    DataSet dsQ6 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(6) and QAnswer=1) as e");


                    DataSet dsQ7 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(7) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(7) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(7) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(7) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(7) and QAnswer=1) as e");


                    DataSet dsQ8 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(8) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(8) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(8) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(8) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(8) and QAnswer=1) as e");

                    DataSet dsQ9 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(9) and QAnswer=1) as e");


                    DataSet dsQ10 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(10) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(10) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(10) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(10) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(10) and QAnswer=1) as e");


                    DataSet dsQ11 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(11) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(11) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(11) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(11) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(11) and QAnswer=1) as e");


                    DataSet dsQ12 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(12) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(12) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(12) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(12) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(12) and QAnswer=1) as e");


                    DataSet dsQ13 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(13) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(13) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(13) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(13) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(13) and QAnswer=1) as e");


                    DataSet dsQ14 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(14) and QAnswer=1) as e");


                    DataSet dsQ15 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(15) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(15) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(15) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(15) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(15) and QAnswer=1) as e");


                    DataSet dsQ16 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(16) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(16) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(16) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(16) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(16) and QAnswer=1) as e");


                    DataSet dsQ17 = objDB.ExecuteDataSet(CommandType.Text, @"select 
                    a.完全满意,
                    b.满意,
                    c.一般,
                    d.不满意,
                    e.非常不满意
                    from

                    (SELECT 
                    count(QAnswer) as 完全满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(17) and QAnswer=5) as a,

                    (SELECT 
                    count(QAnswer) as 满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(17) and QAnswer=4) as b,

                    (SELECT 
                    count(QAnswer) as 一般
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(17) and QAnswer=3) as c,

                    (SELECT 
                    count(QAnswer) as 不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(17) and QAnswer=2) as d,

                    (SELECT 
                    count(QAnswer) as 非常不满意
                      FROM Table_RESULT
                    where paperid = " + n.ToString() + @" and Qid in(17) and QAnswer=1) as e");

                    int n1 = 0;
                    int n2 = 0;
                    int n3 = 0;
                    int n4 = 0;
                    int n5 = 0;
                    int n6 = 0;
                    int n7 = 0;
                    
                    DataSet dsQ18 = objDB.ExecuteDataSet(CommandType.Text, @"select QAnswer from Table_RESULT
                                    where paperid = " + n.ToString() + @" and Qid=18");

                    if (dsQ18 != null && dsQ18.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ18.Tables[0].Rows.Count; i++)
                        {
                            string val = dsQ18.Tables[0].Rows[i][0].ToString();
                            if (val.Substring(0, 1).Equals("1"))
                            {
                                n1++;
                            }
                            if (val.Substring(1, 1).Equals("1"))
                            {
                                n2++;
                            }
                            if (val.Substring(2, 1).Equals("1"))
                            {
                                n3++;
                            }
                            if (val.Substring(3, 1).Equals("1"))
                            {
                                n4++;
                            }
                            if (val.Substring(4, 1).Equals("1"))
                            {
                                n5++;
                            }
                            if (val.Substring(5, 1).Equals("1"))
                            {
                                n6++;
                            }
                            if (val.Substring(6, 1).Equals("1"))
                            {
                                n7++;
                            }
                        }
                    }


                    DataSet dsQ19 = objDB.ExecuteDataSet(CommandType.Text, @"select QAnswer from Table_RESULT
                                    where paperid = " + n.ToString() + @" and Qid=18 and len(QAnswer)>9");


  
                    dcwjDataSet ds = new dcwjDataSet();

                    if (dsTmp != null && dsTmp.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsTmp.Tables[0].Rows.Count; i++)
                        {
                            ds.单班报告.Add单班报告Row("课程内容", dsTmp.Tables[0].Rows[i][0].ToString());
                            ds.单班报告.Add单班报告Row("培训方法", dsTmp.Tables[0].Rows[i][1].ToString());
                            ds.单班报告.Add单班报告Row("关于讲师", dsTmp.Tables[0].Rows[i][2].ToString());
                            ds.单班报告.Add单班报告Row("培训组织", dsTmp.Tables[0].Rows[i][3].ToString());
                        }
                    }
                    if (dsTmp2 != null && dsTmp2.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsTmp2.Tables[0].Rows.Count; i++)
                        {
                            ds.课程内容.Add课程内容Row("完全满意", dsTmp2.Tables[0].Rows[i][0].ToString());
                            ds.课程内容.Add课程内容Row("满意", dsTmp2.Tables[0].Rows[i][1].ToString());
                            ds.课程内容.Add课程内容Row("一般", dsTmp2.Tables[0].Rows[i][2].ToString());
                            ds.课程内容.Add课程内容Row("不满意", dsTmp2.Tables[0].Rows[i][3].ToString());
                            ds.课程内容.Add课程内容Row("非常不满意", dsTmp2.Tables[0].Rows[i][4].ToString());
                        }
                    }
                    if (dsTmp3 != null && dsTmp3.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsTmp3.Tables[0].Rows.Count; i++)
                        {
                            ds.课程内容分析.Add课程内容分析Row("针对性", dsTmp3.Tables[0].Rows[i][0].ToString());
                            ds.课程内容分析.Add课程内容分析Row("实用性", dsTmp3.Tables[0].Rows[i][1].ToString());
                            ds.课程内容分析.Add课程内容分析Row("启发性", dsTmp3.Tables[0].Rows[i][2].ToString());
                            ds.课程内容分析.Add课程内容分析Row("完整性", dsTmp3.Tables[0].Rows[i][3].ToString());
                            ds.课程内容分析.Add课程内容分析Row("时效性", dsTmp3.Tables[0].Rows[i][4].ToString());
                        }
                    }
                    if (dsTmp4 != null && dsTmp4.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsTmp4.Tables[0].Rows.Count; i++)
                        {
                            ds.培训方法.Add培训方法Row("完全满意", dsTmp4.Tables[0].Rows[i][0].ToString());
                            ds.培训方法.Add培训方法Row("满意", dsTmp4.Tables[0].Rows[i][1].ToString());
                            ds.培训方法.Add培训方法Row("一般", dsTmp4.Tables[0].Rows[i][2].ToString());
                            ds.培训方法.Add培训方法Row("不满意", dsTmp4.Tables[0].Rows[i][3].ToString());
                            ds.培训方法.Add培训方法Row("非常不满意", dsTmp4.Tables[0].Rows[i][4].ToString());
                        }
                    }
                    if (dsTmp5 != null && dsTmp5.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsTmp5.Tables[0].Rows.Count; i++)
                        {
                            ds.培训方法分析.Add培训方法分析Row("课堂活动", dsTmp5.Tables[0].Rows[i][0].ToString());
                            ds.培训方法分析.Add培训方法分析Row("师生互动", dsTmp5.Tables[0].Rows[i][1].ToString());
                            ds.培训方法分析.Add培训方法分析Row("教学媒体", dsTmp5.Tables[0].Rows[i][2].ToString());
                        }
                    }
                    if (dsTmp6 != null && dsTmp6.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsTmp6.Tables[0].Rows.Count; i++)
                        {
                            ds.关于讲师.Add关于讲师Row("完全满意", dsTmp6.Tables[0].Rows[i][0].ToString());
                            ds.关于讲师.Add关于讲师Row("满意", dsTmp6.Tables[0].Rows[i][1].ToString());
                            ds.关于讲师.Add关于讲师Row("一般", dsTmp6.Tables[0].Rows[i][2].ToString());
                            ds.关于讲师.Add关于讲师Row("不满意", dsTmp6.Tables[0].Rows[i][3].ToString());
                            ds.关于讲师.Add关于讲师Row("非常不满意", dsTmp6.Tables[0].Rows[i][4].ToString());
                        }
                    }
                    if (dsTmp7 != null && dsTmp7.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsTmp7.Tables[0].Rows.Count; i++)
                        {
                            ds.关于讲师分析.Add关于讲师分析Row("围绕课程主题", dsTmp7.Tables[0].Rows[i][0].ToString());
                            ds.关于讲师分析.Add关于讲师分析Row("合理安排时间", dsTmp7.Tables[0].Rows[i][1].ToString());
                            ds.关于讲师分析.Add关于讲师分析Row("活跃课堂气氛", dsTmp7.Tables[0].Rows[i][2].ToString());
                            ds.关于讲师分析.Add关于讲师分析Row("授课热情认真", dsTmp7.Tables[0].Rows[i][3].ToString());
                            ds.关于讲师分析.Add关于讲师分析Row("专业知识丰富", dsTmp7.Tables[0].Rows[i][4].ToString());
                        }
                    }
                    if (dsTmp8 != null && dsTmp8.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsTmp8.Tables[0].Rows.Count; i++)
                        {
                            ds.培训组织.Add培训组织Row("完全满意", dsTmp8.Tables[0].Rows[i][0].ToString());
                            ds.培训组织.Add培训组织Row("满意", dsTmp8.Tables[0].Rows[i][1].ToString());
                            ds.培训组织.Add培训组织Row("一般", dsTmp8.Tables[0].Rows[i][2].ToString());
                            ds.培训组织.Add培训组织Row("不满意", dsTmp8.Tables[0].Rows[i][3].ToString());
                            ds.培训组织.Add培训组织Row("非常不满意", dsTmp8.Tables[0].Rows[i][4].ToString());
                        }
                    }
                    if (dsTmp9 != null && dsTmp9.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsTmp9.Tables[0].Rows.Count; i++)
                        {
                            ds.培训组织分析.Add培训组织分析Row("培训环境", dsTmp9.Tables[0].Rows[i][0].ToString());
                            ds.培训组织分析.Add培训组织分析Row("后勤组织", dsTmp9.Tables[0].Rows[i][1].ToString());
                            ds.培训组织分析.Add培训组织分析Row("教学设备", dsTmp9.Tables[0].Rows[i][2].ToString());
                            ds.培训组织分析.Add培训组织分析Row("培训材料", dsTmp9.Tables[0].Rows[i][3].ToString());
                        }
                    }
                    if (dsTmp10 != null && dsTmp10.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsTmp10.Tables[0].Rows.Count; i++)
                        {
                            ds.Table_PAPER.AddTable_PAPERRow(
                                dsTmp10.Tables[0].Rows[i][0].ToString(),
                                dsTmp10.Tables[0].Rows[i][4].ToString(),
                                dsTmp10.Tables[0].Rows[i][2].ToString(),
                                dsTmp10.Tables[0].Rows[i][3].ToString(),
                                dsTmp10.Tables[0].Rows[i][1].ToString(),
                                dsTmp10.Tables[0].Rows[i][6].ToString(),
                                dsTmp10.Tables[0].Rows[i][7].ToString(),
                                dsTmp10.Tables[0].Rows[i][8].ToString());
                        }
                    }


                    if (dsQ1 != null && dsQ1.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ1.Tables[0].Rows.Count; i++)
                        {
                            ds.Q1.AddQ1Row("完全满意", dsQ1.Tables[0].Rows[i][0].ToString());
                            ds.Q1.AddQ1Row("满意", dsQ1.Tables[0].Rows[i][1].ToString());
                            ds.Q1.AddQ1Row("一般", dsQ1.Tables[0].Rows[i][2].ToString());
                            ds.Q1.AddQ1Row("不满意", dsQ1.Tables[0].Rows[i][3].ToString());
                            ds.Q1.AddQ1Row("非常不满意", dsQ1.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ2 != null && dsQ2.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ2.Tables[0].Rows.Count; i++)
                        {
                            ds.Q2.AddQ2Row("完全满意", dsQ2.Tables[0].Rows[i][0].ToString());
                            ds.Q2.AddQ2Row("满意", dsQ2.Tables[0].Rows[i][1].ToString());
                            ds.Q2.AddQ2Row("一般", dsQ2.Tables[0].Rows[i][2].ToString());
                            ds.Q2.AddQ2Row("不满意", dsQ2.Tables[0].Rows[i][3].ToString());
                            ds.Q2.AddQ2Row("非常不满意", dsQ2.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ3 != null && dsQ3.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ3.Tables[0].Rows.Count; i++)
                        {
                            ds.Q3.AddQ3Row("完全满意", dsQ3.Tables[0].Rows[i][0].ToString());
                            ds.Q3.AddQ3Row("满意", dsQ3.Tables[0].Rows[i][1].ToString());
                            ds.Q3.AddQ3Row("一般", dsQ3.Tables[0].Rows[i][2].ToString());
                            ds.Q3.AddQ3Row("不满意", dsQ3.Tables[0].Rows[i][3].ToString());
                            ds.Q3.AddQ3Row("非常不满意", dsQ3.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ4 != null && dsQ4.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ4.Tables[0].Rows.Count; i++)
                        {
                            ds.Q4.AddQ4Row("完全满意", dsQ4.Tables[0].Rows[i][0].ToString());
                            ds.Q4.AddQ4Row("满意", dsQ4.Tables[0].Rows[i][1].ToString());
                            ds.Q4.AddQ4Row("一般", dsQ4.Tables[0].Rows[i][2].ToString());
                            ds.Q4.AddQ4Row("不满意", dsQ4.Tables[0].Rows[i][3].ToString());
                            ds.Q4.AddQ4Row("非常不满意", dsQ4.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ5 != null && dsQ5.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ5.Tables[0].Rows.Count; i++)
                        {
                            ds.Q5.AddQ5Row("完全满意", dsQ5.Tables[0].Rows[i][0].ToString());
                            ds.Q5.AddQ5Row("满意", dsQ5.Tables[0].Rows[i][1].ToString());
                            ds.Q5.AddQ5Row("一般", dsQ5.Tables[0].Rows[i][2].ToString());
                            ds.Q5.AddQ5Row("不满意", dsQ5.Tables[0].Rows[i][3].ToString());
                            ds.Q5.AddQ5Row("非常不满意", dsQ5.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ6 != null && dsQ6.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ6.Tables[0].Rows.Count; i++)
                        {
                            ds.Q6.AddQ6Row("完全满意", dsQ6.Tables[0].Rows[i][0].ToString());
                            ds.Q6.AddQ6Row("满意", dsQ6.Tables[0].Rows[i][1].ToString());
                            ds.Q6.AddQ6Row("一般", dsQ6.Tables[0].Rows[i][2].ToString());
                            ds.Q6.AddQ6Row("不满意", dsQ6.Tables[0].Rows[i][3].ToString());
                            ds.Q6.AddQ6Row("非常不满意", dsQ6.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ7 != null && dsQ7.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ7.Tables[0].Rows.Count; i++)
                        {
                            ds.Q7.AddQ7Row("完全满意", dsQ7.Tables[0].Rows[i][0].ToString());
                            ds.Q7.AddQ7Row("满意", dsQ7.Tables[0].Rows[i][1].ToString());
                            ds.Q7.AddQ7Row("一般", dsQ7.Tables[0].Rows[i][2].ToString());
                            ds.Q7.AddQ7Row("不满意", dsQ7.Tables[0].Rows[i][3].ToString());
                            ds.Q7.AddQ7Row("非常不满意", dsQ7.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ8 != null && dsQ8.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ8.Tables[0].Rows.Count; i++)
                        {
                            ds.Q8.AddQ8Row("完全满意", dsQ8.Tables[0].Rows[i][0].ToString());
                            ds.Q8.AddQ8Row("满意", dsQ8.Tables[0].Rows[i][1].ToString());
                            ds.Q8.AddQ8Row("一般", dsQ8.Tables[0].Rows[i][2].ToString());
                            ds.Q8.AddQ8Row("不满意", dsQ8.Tables[0].Rows[i][3].ToString());
                            ds.Q8.AddQ8Row("非常不满意", dsQ8.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ9 != null && dsQ9.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ9.Tables[0].Rows.Count; i++)
                        {
                            ds.Q9.AddQ9Row("完全满意", dsQ9.Tables[0].Rows[i][0].ToString());
                            ds.Q9.AddQ9Row("满意", dsQ9.Tables[0].Rows[i][1].ToString());
                            ds.Q9.AddQ9Row("一般", dsQ9.Tables[0].Rows[i][2].ToString());
                            ds.Q9.AddQ9Row("不满意", dsQ9.Tables[0].Rows[i][3].ToString());
                            ds.Q9.AddQ9Row("非常不满意", dsQ9.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ10 != null && dsQ10.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ10.Tables[0].Rows.Count; i++)
                        {
                            ds.Q10.AddQ10Row("完全满意", dsQ10.Tables[0].Rows[i][0].ToString());
                            ds.Q10.AddQ10Row("满意", dsQ10.Tables[0].Rows[i][1].ToString());
                            ds.Q10.AddQ10Row("一般", dsQ10.Tables[0].Rows[i][2].ToString());
                            ds.Q10.AddQ10Row("不满意", dsQ10.Tables[0].Rows[i][3].ToString());
                            ds.Q10.AddQ10Row("非常不满意", dsQ10.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ11 != null && dsQ11.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ11.Tables[0].Rows.Count; i++)
                        {
                            ds.Q11.AddQ11Row("完全满意", dsQ11.Tables[0].Rows[i][0].ToString());
                            ds.Q11.AddQ11Row("满意", dsQ11.Tables[0].Rows[i][1].ToString());
                            ds.Q11.AddQ11Row("一般", dsQ11.Tables[0].Rows[i][2].ToString());
                            ds.Q11.AddQ11Row("不满意", dsQ11.Tables[0].Rows[i][3].ToString());
                            ds.Q11.AddQ11Row("非常不满意", dsQ11.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ12 != null && dsQ12.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ12.Tables[0].Rows.Count; i++)
                        {
                            ds.Q12.AddQ12Row("完全满意", dsQ12.Tables[0].Rows[i][0].ToString());
                            ds.Q12.AddQ12Row("满意", dsQ12.Tables[0].Rows[i][1].ToString());
                            ds.Q12.AddQ12Row("一般", dsQ12.Tables[0].Rows[i][2].ToString());
                            ds.Q12.AddQ12Row("不满意", dsQ12.Tables[0].Rows[i][3].ToString());
                            ds.Q12.AddQ12Row("非常不满意", dsQ12.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ13 != null && dsQ13.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ13.Tables[0].Rows.Count; i++)
                        {
                            ds.Q13.AddQ13Row("完全满意", dsQ13.Tables[0].Rows[i][0].ToString());
                            ds.Q13.AddQ13Row("满意", dsQ13.Tables[0].Rows[i][1].ToString());
                            ds.Q13.AddQ13Row("一般", dsQ13.Tables[0].Rows[i][2].ToString());
                            ds.Q13.AddQ13Row("不满意", dsQ13.Tables[0].Rows[i][3].ToString());
                            ds.Q13.AddQ13Row("非常不满意", dsQ13.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ14 != null && dsQ14.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ14.Tables[0].Rows.Count; i++)
                        {
                            ds.Q14.AddQ14Row("完全满意", dsQ14.Tables[0].Rows[i][0].ToString());
                            ds.Q14.AddQ14Row("满意", dsQ14.Tables[0].Rows[i][1].ToString());
                            ds.Q14.AddQ14Row("一般", dsQ14.Tables[0].Rows[i][2].ToString());
                            ds.Q14.AddQ14Row("不满意", dsQ14.Tables[0].Rows[i][3].ToString());
                            ds.Q14.AddQ14Row("非常不满意", dsQ14.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ15 != null && dsQ15.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ15.Tables[0].Rows.Count; i++)
                        {
                            ds.Q15.AddQ15Row("完全满意", dsQ15.Tables[0].Rows[i][0].ToString());
                            ds.Q15.AddQ15Row("满意", dsQ15.Tables[0].Rows[i][1].ToString());
                            ds.Q15.AddQ15Row("一般", dsQ15.Tables[0].Rows[i][2].ToString());
                            ds.Q15.AddQ15Row("不满意", dsQ15.Tables[0].Rows[i][3].ToString());
                            ds.Q15.AddQ15Row("非常不满意", dsQ15.Tables[0].Rows[i][4].ToString());
                        }
                    }

                    if (dsQ16 != null && dsQ16.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ16.Tables[0].Rows.Count; i++)
                        {
                            ds.Q16.AddQ16Row("完全满意", dsQ16.Tables[0].Rows[i][0].ToString());
                            ds.Q16.AddQ16Row("满意", dsQ16.Tables[0].Rows[i][1].ToString());
                            ds.Q16.AddQ16Row("一般", dsQ16.Tables[0].Rows[i][2].ToString());
                            ds.Q16.AddQ16Row("不满意", dsQ16.Tables[0].Rows[i][3].ToString());
                            ds.Q16.AddQ16Row("非常不满意", dsQ16.Tables[0].Rows[i][4].ToString());
                        }               
                    }

                    if (dsQ17 != null && dsQ1.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ17.Tables[0].Rows.Count; i++)
                        {
                            ds.Q17.AddQ17Row("完全满意", dsQ17.Tables[0].Rows[i][0].ToString());
                            ds.Q17.AddQ17Row("满意", dsQ17.Tables[0].Rows[i][1].ToString());
                            ds.Q17.AddQ17Row("一般", dsQ17.Tables[0].Rows[i][2].ToString());
                            ds.Q17.AddQ17Row("不满意", dsQ17.Tables[0].Rows[i][3].ToString());
                            ds.Q17.AddQ17Row("非常不满意", dsQ17.Tables[0].Rows[i][4].ToString());
                        }
                    }


                    //去除0值
                    foreach (DataTable t in ds.Tables)
                    {
                        if (t != null && t.Rows.Count > 0 && t.Columns.Count > 1)
                        {
                            for (int i = t.Rows.Count - 1; i >= 0; i--)
                            {
                                DataRow dr = t.Rows[i];
                                if (t.Rows[i][1] != null && t.Rows[i][1].ToString().Equals("0"))
                                {
                                    t.Rows.Remove(dr);
                                }
                            } 
                        }
                    }

                    //分离需求和评论>>>>>>>>>>>>>>>
                    if (dsQ19 != null && dsQ19.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsQ19.Tables[0].Rows.Count; i++)
                        {
                            string c = dsQ19.Tables[0].Rows[i][0].ToString();

                            int pi = c.IndexOf("#");
                            int ph = c.IndexOf("|");

                            string ii = string.Empty;
                            string hh = string.Empty;

                            ii = c.Substring(pi + 1, ph - pi - 1);
                            hh = c.Substring(ph + 1, c.Length - ph - 1);
                            ds.dtComments.AdddtCommentsRow(ii, hh);
                        }
                    }
                    //分离需求和评论<<<<<<<<<<<<<<<<

                    ds.Q18.AddQ18Row("调整课程结构及内容深度", n1.ToString());
                    ds.Q18.AddQ18Row("增加实用性知识，补充课程案例", n2.ToString());
                    ds.Q18.AddQ18Row("增加讲师对知识点表达、示范的清晰易懂性", n3.ToString());
                    ds.Q18.AddQ18Row("讲师增加讲解深度、引导学员思考", n4.ToString());
                    ds.Q18.AddQ18Row("丰富课堂活动（演练、研讨）", n5.ToString());
                    ds.Q18.AddQ18Row("增加培训班次、课时", n6.ToString());
                    ds.Q18.AddQ18Row("改善培训环境", n7.ToString());


                    ReportDataSource rds0 = new ReportDataSource("单班报告", (DataTable)ds.单班报告);
                    ReportDataSource rds1 = new ReportDataSource("课程内容", (DataTable)ds.课程内容);
                    ReportDataSource rds2 = new ReportDataSource("课程内容分析", (DataTable)ds.课程内容分析);
                    ReportDataSource rds3 = new ReportDataSource("培训方法", (DataTable)ds.培训方法);
                    ReportDataSource rds4 = new ReportDataSource("培训方法分析", (DataTable)ds.培训方法分析);
                    ReportDataSource rds5 = new ReportDataSource("关于讲师", (DataTable)ds.关于讲师);
                    ReportDataSource rds6 = new ReportDataSource("关于讲师分析", (DataTable)ds.关于讲师分析);
                    ReportDataSource rds7 = new ReportDataSource("培训组织", (DataTable)ds.培训组织);
                    ReportDataSource rds8 = new ReportDataSource("培训组织分析", (DataTable)ds.培训组织分析);
                    ReportDataSource rds9 = new ReportDataSource("Table_Paper", (DataTable)ds.Table_PAPER);
                    ReportDataSource rds10 = new ReportDataSource("Q1", (DataTable)ds.Q1);
                    ReportDataSource rds11 = new ReportDataSource("Q2", (DataTable)ds.Q2);
                    ReportDataSource rds12 = new ReportDataSource("Q3", (DataTable)ds.Q3);
                    ReportDataSource rds13 = new ReportDataSource("Q4", (DataTable)ds.Q4);
                    ReportDataSource rds14 = new ReportDataSource("Q5", (DataTable)ds.Q5);
                    ReportDataSource rds15 = new ReportDataSource("Q6", (DataTable)ds.Q6);
                    ReportDataSource rds16 = new ReportDataSource("Q7", (DataTable)ds.Q7);
                    ReportDataSource rds17 = new ReportDataSource("Q8", (DataTable)ds.Q8);
                    ReportDataSource rds18 = new ReportDataSource("Q9", (DataTable)ds.Q9);
                    ReportDataSource rds19 = new ReportDataSource("Q10", (DataTable)ds.Q10);
                    ReportDataSource rds20 = new ReportDataSource("Q11", (DataTable)ds.Q11);
                    ReportDataSource rds21 = new ReportDataSource("Q12", (DataTable)ds.Q12);
                    ReportDataSource rds22 = new ReportDataSource("Q13", (DataTable)ds.Q13);
                    ReportDataSource rds23 = new ReportDataSource("Q14", (DataTable)ds.Q14);
                    ReportDataSource rds24 = new ReportDataSource("Q15", (DataTable)ds.Q15);
                    ReportDataSource rds25 = new ReportDataSource("Q16", (DataTable)ds.Q16);
                    ReportDataSource rds26 = new ReportDataSource("Q17", (DataTable)ds.Q17);
                    ReportDataSource rds27 = new ReportDataSource("Q18", ds.Q18.Select("", "项目得分 desc"));
                    ReportDataSource rds28 = new ReportDataSource("bcdb", (DataTable)ds.bcdb);
                    ReportDataSource rds29 = new ReportDataSource("dtComments", (DataTable)ds.dtComments);

                    string viewdata = string.Empty;
                    if (Request["viewdata"] != null)
                    {
                        viewdata = Request["viewdata"].ToString();
                    }
                    if (string.IsNullOrEmpty(viewdata))
                    {
                        ReportViewer1.LocalReport.ReportPath = @"report\dbbg.rdlc";
                    }
                    else
                    {
                        ReportViewer1.LocalReport.ReportPath = @"report\dbbg_data.rdlc";
                    }

                    ReportViewer1.LocalReport.DataSources.Add(rds0);
                    ReportViewer1.LocalReport.DataSources.Add(rds1);
                    ReportViewer1.LocalReport.DataSources.Add(rds2);
                    ReportViewer1.LocalReport.DataSources.Add(rds3);
                    ReportViewer1.LocalReport.DataSources.Add(rds4);
                    ReportViewer1.LocalReport.DataSources.Add(rds5);
                    ReportViewer1.LocalReport.DataSources.Add(rds6);
                    ReportViewer1.LocalReport.DataSources.Add(rds7);
                    ReportViewer1.LocalReport.DataSources.Add(rds8);
                    ReportViewer1.LocalReport.DataSources.Add(rds9);
                    ReportViewer1.LocalReport.DataSources.Add(rds10);
                    ReportViewer1.LocalReport.DataSources.Add(rds11);
                    ReportViewer1.LocalReport.DataSources.Add(rds12);
                    ReportViewer1.LocalReport.DataSources.Add(rds13);
                    ReportViewer1.LocalReport.DataSources.Add(rds14);
                    ReportViewer1.LocalReport.DataSources.Add(rds15);
                    ReportViewer1.LocalReport.DataSources.Add(rds16);
                    ReportViewer1.LocalReport.DataSources.Add(rds17);
                    ReportViewer1.LocalReport.DataSources.Add(rds18);
                    ReportViewer1.LocalReport.DataSources.Add(rds19);
                    ReportViewer1.LocalReport.DataSources.Add(rds20);
                    ReportViewer1.LocalReport.DataSources.Add(rds21);
                    ReportViewer1.LocalReport.DataSources.Add(rds22);
                    ReportViewer1.LocalReport.DataSources.Add(rds23);
                    ReportViewer1.LocalReport.DataSources.Add(rds24);
                    ReportViewer1.LocalReport.DataSources.Add(rds25);
                    ReportViewer1.LocalReport.DataSources.Add(rds26);
                    ReportViewer1.LocalReport.DataSources.Add(rds27);
                    ReportViewer1.LocalReport.DataSources.Add(rds28);
                    ReportViewer1.LocalReport.DataSources.Add(rds29);

                    ReportViewer1.LocalReport.Refresh();
                }
                catch (Exception ex)
                {
                    Response.Write(ex.Message);
                }
            }
        }
    }
}